#include <iostream>
#include <vector>
using namespace std;
class Solution {
   public:
    int missingNumber(vector<int>& nums) {
        const int len = nums.size() + 1;
        int* arr = (int*)calloc(len, 4);
        for (int n : nums) {
            arr[n] = 1;
        }
        for (int i = 0; i < nums.size() + 1; i++) {
            if (arr[i] == 0) {
                return i;
            }
        }
        return -1;
    }
};
int main() {
    return 0;
}
